<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>退换货记录-{{$SEO['title']}}</title>
    <meta name="keywords" content="{{$SEO['keywords']}}"/>
    <meta name="description" content="{{$SEO['description']}}"/>

    <!--公用css引用-->
    @include('front.common.style')
    <!--END/公用css引用-->
    <link rel="stylesheet" href="{{ URL::asset('/') }}css/userCenter.css">
</head>
<body>

@inject('orderGoodsService','App\Interfaces\OrderGoodsService')
@inject('orderService','App\Interfaces\OrderService')
@inject('refundGoodsOperationRecordService','App\Interfaces\RefundGoodsOperationRecordService')


<!--公共头部-->
@include('front.common.header')
<!--END/公共头部-->

<div class="inbox user-center">
    <div class="layout-margin unend">
        <div class="sidebar-end"></div>
        <div class="sidebar-start">
            @include('front.common.leftnav')
        </div>

        <!--主体部分-->
        <div class="container">
            <div class="container-inner u-order">
                <div class="order-list">
                    <div class="order-list-big fn-ohide fn-mb20">
                        <div class="search-box">
                            <form class="bl-form" method="get" action="">
                                <div class="fn-dib fn-rel keybox">
                                    {!! Form::text('condition',$search['condition'],['class'=>'fn-tinput key form-control','autocomplete'=>'off','placeholder'=>'返修/退换货编号、订单编'])!!}
                                    <span class="fn-dib submit">
                                        <button class="fn-btn btn-submit" type="submit">搜索</button>
                                    </span>
                                    <i class="icon icon-search fn-abs"></i>
                                </div>
                            </form>
                        </div>
                        <div class="order-type">
                            <ul class="link-list link-list-skin2">
                                <li class="cur"><a href="{{route('my.refund.record')}}">退货记录</a></li>
                            </ul>
                        </div>
                    </div>


                    <table class="bl-table bl-table-tdLi table-tc ui-brd-box1 return-order-list">
                        <tr>

                            <th style="width: 120px;">返修/退换货编号</th>
                            <th style="width: 120px;">订单编号</th>
                            <th class="tl">商品名称</th>
                            <th style="width: 130px;">申请时间

                            </th>
                            <th style="width: 130px;">
                                状态
                            </th>
                            <th style="width: 120px;">操作</th>

                        </tr>
                        @foreach($refundOrders as $key=>$item)

                            <tr>
                                <td>
                                    <a href="{{route('my.refund.show',[@$item->refund_sn])}}" class="text-color-8">{{@$item->refund_sn}}</a>
                                </td>
                                <td>
                                    <?php $orders = $orderService->getByOrderSn(@$item->order_sn); ?>
                                    <a href="{{route('my.order.show',[$orders['order_id']])}}" class="text-color-8">{{@$item->order_sn}}</a>
                                </td>
                                <td class="tl">
                                    <a href="{{route('front.goods.detail',[$item->goods_id])}}" class="text-color-8" title="{{@$orderGoods->goods_name}}">
                                        <?php
                                        @$orderGoods = $orderGoodsService->getByOrderGoodsId($item->order_goods_id);
                                        ?>
                                        {{@$orderGoods->goods_name}}
                                    </a>
                                </td>
                                <td>
                                    <p class="text-color-7">
                                        <?php
                                        $refundGoodOperationRecord = $refundGoodsOperationRecordService->getByRefundSn($item->refund_sn);
                                        foreach ($refundGoodOperationRecord as $items) {
                                            if($items->operation_status==1){
                                                echo $items->operation_time;
                                                break;
                                            }
                                        }
                                        ?>
                                    </p>
                                </td>
                                <td>

                                    <?php
                                        switch($item->refund_status){
                                            case 1:
                                                echo '审核中';
                                                break;
                                            case 2:
                                                echo '处理中';
                                                break;
                                            case 3:
                                                echo '处理完毕';
                                                break;
                                            case 4:
                                                echo '审核不通过';
                                                break;
                                            case 5:
                                                echo '已取消';
                                                break;
                                        }
                                    ?>
                                </td>
                                <td>
                                    <a href="{{route('my.refund.show',[@$item->refund_sn])}}" class="text-color-8">查看</a>
                                </td>
                            </tr>
                        @endforeach

                    </table>
                    <div class="pager pager-m20 fn-tr">
                            {!! $refundOrders->appends(['condition' => $search['condition'], 'refund_status' => $search['refund_status']])->render() !!}

                    </div>


                </div>

                <div class="bl-notes">
                    <div class="bl-note-content">
                        <h4>返修/退换货申请常见问题</h4>
                        <ul>
                            <li>
                                1.“申请”按钮若为灰色，可能是因为订单尚未完成或该商品正在返修/退换货中;
                            </li>
                            <li>
                                2.查看 <a href="/help/return-policy" class="text-color-8">售后政策</a>;
                            </li>
                        </ul>
                    </div>
                </div>


            </div>

        </div>
        <!--END/主体部分-->

    </div>
</div>

<!--公共尾部-->
@include('front.common.footer')
<!--END/公共尾部-->

<!--公用js引用-->
@include('front.common.script')
<!--END/公用js引用-->

</body>
</html>